<template>
  <div>
    <Table border :columns="columns" :data="dataList"></Table>
    <Page class="page_style" :total="searchInfo.totalnum" :current="searchInfo.pageNo"
          :page-size="searchInfo.PageSize" @on-change="changePageNo" show-total  show-sizer @on-page-size-change="size"/>
  </div>
</template>
<script>
export default {
  data () {
    return {
      searchInfo: {
        totalnum: 0,
        pageNo: 1,
        pageSize: 10,
        department_name: ''
      },
      dataList: [],
      columns: []
    }
  },
  methods: {
    init () {
      console.log('这是初始化的方法')
    },
    size (pageSize) {
      this.searchInfo.currentPageSize = pageSize
      this.changePageNo(this.searchInfo.pageNo)
    },
    changePageNo (pageNo) {
      console.log(pageNo)
      this.searchInfo.pageNo = pageNo
      this.init()
    }
  },
  mounted () {
    this.init()
  }
}
</script>
<style></style>
